package com.ddm.config;
import okhttp3.*;
import java.io.IOException;

public class QianFan{

    static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
    public static void main(String[] args) throws IOException {

            MediaType mediaType = MediaType.parse("application/json");
            RequestBody body = RequestBody.create(mediaType, "{\"app_id\":\"73af363b-f8fc-4c6a-9945-415530255224\"}");
            Request request = new Request.Builder()
                    .url("https://qianfan.baidubce.com/v2/app/conversation")
                    .method("POST", body)
                    .addHeader("Content-Type", "application/json")
                    .addHeader("X-Appbuilder-Authorization", "Bearer bce-v3/ALTAK-rBJZFyklew7WX75PkeWom/7e955c195bfd70012d07be06f00d1867893d187c")
                    .build();
            Response response = HTTP_CLIENT.newCall(request).execute();
            System.out.println(response.body().string());
    }
}